﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Benchmark.Db.Base.Connection;
using Benchmark.Db.Base;
using Benchmark.Db.Base.DataObjects;

namespace Benchmark.Db
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void LoadAdapters()
        {
            comboAdapters.Items.Clear();
            IDbBenchmarkConnectionV1[] connectors = Loader.GetConnectors();
            foreach (IDbBenchmarkConnectionV1 connection in connectors)
                comboAdapters.Items.Add(connection);
        }


        private void buttonStartTest_Click(object sender, RoutedEventArgs e)
        {
            IDbBenchmarkConnectionV1 connector = comboAdapters.SelectedItem as IDbBenchmarkConnectionV1;
            connector.Initialize<Record1>();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.LoadAdapters();
        }
    }
}
